package com.pb.b2b.common.bean;

import java.util.Locale;

import javax.faces.bean.ManagedBean;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.pb.b2b.bean.BaseBean;
import com.pb.b2b.util.FacesUtils;

@Component
@Scope("session")
@ManagedBean(name = "userSessionBean")
public class UserSessionBean extends BaseBean {

	private static final Logger logger = LoggerFactory.getLogger(UserSessionBean.class);

	private Locale locale;
	boolean hataVarmi;

	public boolean isHataVarmi() {
		return FacesUtils.getFacesContext().getMessages().hasNext();
	}

	public Locale getLocale() {
		if (this.locale == null)
			return new Locale("tr");
		return locale;
	}

	public void setLocale(Locale locale) {
		this.locale = locale;
	}

	@Override
	public String executeAction() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String confirmAction() {
		// TODO Auto-generated method stub
		return null;
	}

}
